<template>
  <basePage :show-tabbar="false" :page-params="pageParams">
    <view class="base">
      <text class="image font_family icon-chenggong_tongyong_1 " />
      <view style="margin-top: 10px; font-weight: 600; font-size: 18px;">支付成功</view>
      <view class="money">
        <view style="font-size: 24px;">￥</view>
        <text>{{ Number(amount).toFixed(2) }}</text>
      </view>
 <!-- #ifdef MP-WEIXIN -->
        <button
        v-if="fromType &&fromType == 'M'"
        class="button"
        style="width: 89%;"
        :plain="true"
        @click="goIndexM"
      >返回鑫方盛</button>
      <button
        v-else
        class="button"
        bindtap="onCloseTap"
        style="width: 89%;"
        open-type="launchApp"
        app-parameter="0"
        :plain="true"
        binderror="launchAppError"
      >返回鑫方盛</button>

      <!-- #endif -->

    </view>
  </basePage>
</template>

<script>
import basePage from '@/components/base-page';
export default {
  name: 'AppPaymentSuccess',
  components: {
    basePage
  },
  data() {
    return {
      amount: 0,
      pageParams: {
        state: null,
        emptyTitle: '',
        errorTitle: '',
        showButton: false
      },
       fromType:'',//此参数是用来接受后端接口返回url-link上的fromType，解决m站支付成功后点击返回鑫方盛按钮回到m站首页
    }
  },
  onLoad(option) {
    this.amount = option.amount
    this.fromType =option.fromType
    console.log(this.fromType,'来源是M')

  },
   methods: {
    goIndexM(){
      uni.navigateTo({ url: '/shopIndex/shopIndex' })
    }
  }

}
</script>

<style scoped lang="scss">
.base {
  align-items: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
  .image{
    margin: 80rpx auto 0;
    font-size:160rpx;
    text-align: center;
    color: $uni-color-success;
  }
  .money {
    margin-top: 20rpx;
    font-size: 64rpx;
    justify-content: center;
    flex-direction: row;
    display: flex;
  }
  .button {
    margin-top: 66rpx;
    border-radius: 44rpx;
    align-items: center;
    justify-content: center;
    display: flex;
    height: 88rpx;
    border: 0;
    font-size:$uni-font-size-lg;
    color: $uni-text-color-inverse;
    background-color:$uni-orange;
  }
}

</style>
